//
//  SchoolSubVC.m
//  BrushFace
//
//  Created by Harry on 16/1/27.
//  Copyright © 2016年 Zzz. All rights reserved.
//

#import "SchoolSubVC.h"
#import "EducationVC.h"
@interface SchoolSubVC ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation SchoolSubVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navBar setTitle:@"学历学籍"];
    [self.navBar setLeftBtn:NAV_BAR_LEFT_BTN_TYPE_BLUE];
    _tableView.delegate = self;
    _tableView.dataSource = self;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    return _dataArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *cellName = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellName];
    if (cell == nil)
    {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellName];
        
    }
    
    NSDictionary *dic = _dataArray[indexPath.row];
    
    cell.textLabel.text = dic[@"name"];
    
    
    return cell;
    
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSArray *array = self.navigationController.childViewControllers;
    EducationVC *eduVC = [array objectAtIndex:array.count-3];
    if (_SCHOOLSUBTYPE == SCHOOLSUBTYPE_adress)
    {
        eduVC.addressDic = _dataArray[indexPath.row];
        eduVC.proName = _proName;
    }
    else
    {
        eduVC.schoolDic = _dataArray[indexPath.row];
    }
    
    [self.navigationController popToViewController:eduVC animated:YES];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
